<?php
require_once __Dir__ . '/../simpletest/autorun.php';
require_once __Dir__ . '/../../Core/BonoHomeCore/BonoHomeCoreService.php';

class TestOfAttachBillToOperation extends UnitTestCase 
{
	/*
		Check a correct add answer
	*/
    function testCorrectAttachBillToOperation() 
	{
		$accountName = "test account";
		$service = new BonoHomeCoreService();
		$date1 = DateTime::createFromFormat('d/m/Y', "01/01/2014");
		$startDate = $date1->format('Y-m-d');
		$date2 = DateTime::createFromFormat('d/m/Y', "30/12/2014");
		$endDate = $date2->format('Y-m-d');
		$operations = $service->getOperations($accountName, $startDate, $endDate);
			
		if(count($operations->response) > 0)
		{
				$service = new BonoHomeCoreService();
				$response = $service->attachBill($operations->response[0]);
				$this->assertTrue($response->response->Id > 0);
		}
		else
		{
			$this->assertTrue(false);
		}
    }
	
	/*
		Check an invalid add answer
	*/
    function testInvalidAttachBillToOperation() 
	{
    }
}
?>